import {
  ChangeDetectionStrategy,
  Component,
  Inject,
  OnInit,
} from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';

@Component({
  selector: 'app-new-task',
  templateUrl: './new-task.component.html',
  styleUrls: ['./new-task.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class NewTaskComponent implements OnInit {
  title = '';
  priorities = [
    {
      value: 1,
      label: '紧急',
    },
    {
      value: 2,
      label: '重要',
    },
    {
      value: 3,
      label: '普通',
    },
  ];

  constructor(
    @Inject(MAT_DIALOG_DATA) private data,
    private dialogRef: MatDialogRef<NewTaskComponent>
  ) {}

  ngOnInit(): void {
    this.title = this.data.title;
    console.log(this.data.task);
  }

  onClick(): void {}
}
